package pers.wensheng.patterns.behavioral_pattern.iterator_pattern.jdk_impl;

import java.util.Iterator;

public class Client {
    public static void main(String[] args) {

        MyContainer myContainer = new MyContainer();
        myContainer.add(new Student("sun","001"));
        myContainer.add(new Student("wen","002"));
        myContainer.add(new Student("sheng","003"));
        Iterator<Student> iterator = myContainer.iterator();

        while (iterator.hasNext()) {
            System.out.println(iterator.next());
        }

    }
}
